package lormi.meipin.dto;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.validation.constraints.NotNull;

import lormi.meipin.exception.LMException;

/**
 * 工作经历添加接口   = 参数实体类
 * @author ThreeFeng
 * @date 2016年8月12日 下午5:33:28
 */
public class WorkedAddDto {
	
	private Integer userid;

	//工作公司
	@NotNull(message = "100033")
	private String company;

	//工作部门
	private String department;

	//职位名称
	@NotNull(message = "100033")
	private String title;

	//备注
	private String remark;

	//是否对该公司屏蔽
	@NotNull(message = "100033")
	private Byte ishide;

	//培训开始时间
	@NotNull(message = "100033")
	private String begin;

	//培训结束时间
	@NotNull(message = "100033")
	private String end;

	public Integer getUserid() {
		return userid;
	}

	public void setUserid(Integer userid) {
		this.userid = userid;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		this.department = department;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Byte getIshide() {
		return ishide;
	}

	public void setIshide(Byte ishide) {
		this.ishide = ishide;
	}

	public String getBegin() throws LMException {
		return this.begin;
	}
	
	public Date getBeginForDate() throws LMException {
		try {
			return new SimpleDateFormat("yyyy-M-d").parse(getBegin());
		} catch (ParseException e) {
			throw new LMException();
		}
	}

	public void setBegin(String begin) {
		this.begin = begin;
	}

	public String getEnd(){
		return this.end;
	}
	
	public Date getEndForDate() throws LMException {
		try {
			return new SimpleDateFormat("yyyy-M-d").parse(getEnd());
		} catch (ParseException e) {
			throw new LMException();
		}
	}

	public void setEnd(String end) {
		this.end = end;
	}

	
	
}
